/**
 * 
 */
package com.googlecode.dynargs.model.type;

import java.util.List;

import com.googlecode.dynargs.model.constraints.Constraint;

/**
 * @author Federico De Faveri defaveri@gmail.com
 *
 */
public class ObjectField {
	
	protected String name;
	protected Type type;
	protected String label;
	protected String description;
	
	protected List<Constraint> constraints;
	
	/**
	 * @param name
	 * @param type
	 */
	public ObjectField(String name, Type type) {
		this.name = name;
		this.type = type;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the type
	 */
	public Type getType() {
		return type;
	}

	/**
	 * @return the label
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * @param label the label to set
	 */
	public void setLabel(String label) {
		this.label = label;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the constraints
	 */
	public List<Constraint> getConstraints() {
		return constraints;
	}

	/**
	 * @param constraints the constraints to set
	 */
	public void setConstraints(List<Constraint> constraints) {
		this.constraints = constraints;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("ObjectField [name=");
		builder.append(name);
		builder.append(", type=");
		builder.append(type);
		builder.append(", label=");
		builder.append(label);
		builder.append(", description=");
		builder.append(description);
		builder.append(", constraints=");
		builder.append(constraints);
		builder.append("]");
		return builder.toString();
	}
}
